-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix Enter fails to confirm in the New Document dialog after editing values #3615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Enter fails to confirm in the New Document dialog after editing values #3615
Conversation
|
!build |
|
|
|
|
I removed the classes from the |
|
!build |
|
…w document window
Co-authored-by: Timon <[email protected]>
513653d to
07d6a0d
Compare
|
!build |
|
timon-schelling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I would say we should merge this, having keyboard event listeners scattered in frontend code needs to be cleaned up at some point, but this is not much of a maintenance burden on its own and a good UX improvement.
| // Add an event to handle enter press on all focusable fields(inputs) inside the popup | ||
| const floatingMenu = (self?.div?.()?.querySelector("[data-floating-menu-content]") || undefined) as HTMLDivElement | undefined; | ||
| floatingMenu?.addEventListener("keydown", function (event) { | ||
| if (event.key == "Enter") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT : maybe use === , instead of == , for string comparisons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look closely at these files
MenuList.svelte:68-75
ColorPicker.svelte:408-410
ScrollbarInput.svelte:201-207
we always have a onDestroy after an onMount , not related to the changes from this PR , but would probably be a good idea to cleanup this stale event handler
Fixes: #3601
Now it behaves normally:
show_solved_issue.mp4